import react from 'react'
import moduleName from '../assets/less/test.css'
console.log(moduleName);


class From extends react.Component {
  constructor(props){
    super(props)
    this.input = react.createRef();
  }
  state = {
    value: ''
  }
  handleChange = (e) => {
    console.log(e.target.value);
    this.setState({value:e.target.value})
  }
  render() {

    return (
      <div className="main">
        {/* 如果你指定了value值，则必须为指定一个state的属性 */}
        <input type="text"
          placeholder="请输入你的名字"
          value={this.state.value}
          onChange={this.handleChange}

        />
        {/*   // onChange={this.handleChange} */}
        <input type="text"
          defaultValue="Bob"
          ref={this.input}
          onChange={this.handleChange}
        />
      </div>
    )
  }

}

export default From